package com.truing.flycodebill.workbench.web.controller;

import com.truing.flycodebill.workbench.domain.BillSort;
import com.truing.flycodebill.workbench.service.BillSortService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@ResponseBody
@CrossOrigin
public class BillSortController {

    @Resource
    private BillSortService billSortService;

    @RequestMapping("/showBillSort.do")
    public Object showBillSort(){
        String typeIdExpend = "1";
        String typeIdOfIncoming = "2";
        List<BillSort> expendList = billSortService.queryBillByTypeId(typeIdExpend);
        List<BillSort> incomingList = billSortService.queryBillByTypeId(typeIdOfIncoming);
        Map<String,Object> map = new HashMap<>();
        map.put("expendList",expendList);
        map.put("incomingList",incomingList);
        return map;
    }
}
